#!/bin/bash

# Change to the directory 
# cd /path/to/Analysis/Code
cd /Users/xiaosongw/Dropbox/Research/InformedSources/Replication/Analysis/Code

# Define the path to the Stata executable
STATA_PATH="/Applications/Stata/StataMP.app/Contents/MacOS/StataMP" # Adjust this path to where Stata is installed on your system

sudo $STATA_PATH -b do tab1_sumstats.do

sudo $STATA_PATH -b do fig1_uploads.do

sudo $STATA_PATH -b do fig2_example.do

sudo $STATA_PATH -b do fig3_prices.do

sudo $STATA_PATH -b do fig4_zoom.do

sudo $STATA_PATH -b do fig5_margin.do

sudo $STATA_PATH -b do fig6_margindiff.do

sudo $STATA_PATH -b do fig7_freq.do

sudo $STATA_PATH -b do fig8_commit.do

sudo $STATA_PATH -b do fig9_demand.do


# Run the Python script

jupyter nbconvert --to notebook --inplace --execute tab2_choiceprob.ipynb


jupyter nbconvert --to notebook --inplace --execute calibration.ipynb


jupyter nbconvert --to notebook --inplace --execute tab3_calibration.ipynb


